//
//  ActivityViewController.m
//  MoXiProject
//
//  Created by 周筱雯 on 2017/7/19.
//  Copyright © 2017年 周筱雯. All rights reserved.
//

#import "ActivityViewController.h"

@interface ActivityViewController ()
<
    UITableViewDelegate,
    UITableViewDataSource
>

@property (nonatomic,strong) UIView * tempView;

@property (nonatomic, strong) UITableView *tableView;


@end

@implementation ActivityViewController


-(UITableView *) tableView{
    if (!_tableView) {
        _tableView = [[UITableView alloc] initWithFrame:CGRectMake(0, 0, DEF_DEVICE_WIDTH, DEF_CONTENT_INTABBAR_HEIGHT) style:UITableViewStylePlain];
        [_tableView setDelegate:self];
        [_tableView setDataSource:self];              
        [MXUtility setExtraCellLineHidde:_tableView tabHeader:NO tabFooter:NO];
    }
    return _tableView;
}

- (void)viewDidLoad {
    [super viewDidLoad];
    // Do any additional setup after loading the view.
    [self.view addSubview:self.tableView];
    [self.navigationItem setTitle:@"精彩活动"];
    
    self.tableView.mj_header = [MJRefreshNormalHeader headerWithRefreshingBlock:^{
        
        [self createTempView];
        
    }];
    [self.tableView.mj_header beginRefreshing];
}


-(void)createTempView{
    self.tempView = [[UIView alloc]initWithFrame:CGRectMake(0, 0,self.view.width, self.view.height)];
    
    UIImageView *imageview = [[UIImageView alloc]initWithFrame:CGRectMake((CGRectGetWidth(self.tempView.frame) - 50)/2, (CGRectGetHeight(self.tempView.frame) - 154)/2, 50, 50)];
    imageview.image = [UIImage imageNamed:@"wushuju"];
    imageview.contentMode = UIViewContentModeScaleAspectFit;
    [self.tempView addSubview:imageview];
    
    UILabel *label = [[UILabel alloc]initWithFrame:CGRectMake(0,imageview.height+10 + imageview.y, CGRectGetWidth(self.tempView.frame), 30)];
    label.textColor = DEF_COLOR_RGB(215, 215, 215);
    label.textAlignment = NSTextAlignmentCenter;
    label.font = [UIFont systemFontOfSize:15.f];
    label.text = @"　近期暂无精彩活动";
    [self.tempView addSubview:label];
    
    [self.tableView addSubview:self.tempView];
    self.tempView.hidden = NO;
    [self.tableView.mj_header endRefreshing];
}


- (NSInteger)tableView:(UITableView *)tableView numberOfRowsInSection:(NSInteger)section{
    return 0;
}

- (UITableViewCell *)tableView:(UITableView *)tableView cellForRowAtIndexPath:(NSIndexPath *)indexPath{
    return nil;
}
- (void)didReceiveMemoryWarning {
    [super didReceiveMemoryWarning];
    // Dispose of any resources that can be recreated.
}

/*
#pragma mark - Navigation

// In a storyboard-based application, you will often want to do a little preparation before navigation
- (void)prepareForSegue:(UIStoryboardSegue *)segue sender:(id)sender {
    // Get the new view controller using [segue destinationViewController].
    // Pass the selected object to the new view controller.
}
*/

@end
